<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> -回复</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="../favicon.ico">
    <link href="__PUBLIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/css/animate.css" rel="stylesheet">
    <link href="__PUBLIC__/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__PUBLIC__/Widget/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css"/>
    <style type="text/css">
        .submit {
            position: absolute;
            bottom: 0px;
            right: 80px;
        }
        .wrapper-content {
            padding: 20px 20px 0px;
        }
        .ibox-content{
            padding: 15px 20px 50px 20px;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">

                <div class="ibox-content">
                    <form method="post" class="form-horizontal" onsubmit="return false">
                        <div class="form-group">
                            <input type="hidden" id="id" value="<{$id}>">
                        </div>
                        <div class="form-group">
                            <div class="col-sm-4">
                                <textarea id="content" class="form-control" name="content"
                                          style="height:100px;margin-top:7px;"></textarea>
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>

                        <div class="form-group submit">
                            <button class="btn btn-primary" type="button" onclick="save_submit()">回复</button>
                        </div>
                    </form>

                </div>
            </div>
        </div>
    </div>
</div>


<!-- 全局js -->
<script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/js/bootstrap.min.js?v=3.3.6"></script>
<!-- 自定义js -->
<script src="__PUBLIC__/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/js/plugins/layer/layer.min.js"></script>
<script src="__PUBLIC__/js/select.js"></script>

<script type="text/javascript">
    var replyfuncurl = "<{:U('Index/feedback/replyfeedbackfunc','','shtml')}>";
    function save_submit() {
        var op = 1;
        //加载loading层
        var index = layer.load(1, {
            shade: [0.1, '#fff'] //0.1透明度的白色背景
        });
        if (op == 1) {
            var id = $("#id").val();
            var content = $("#content").val();
            if (content == '' || content == null) {
                op = 1;
                layer.close(index);
                layer.alert("请输入回复内容！\r\n", {
                    title: '提示框',
                    icon: 0
                });

                return false;

            }
            $.post(replyfuncurl, {
                    id: id,
                    content: content
                },
                function (data) {
                    if (data.code == '1') {
                        op = 1;
                        layer.close(index);
                        layer.open({
                            content: '回复成功',
                            icon: 6,
                            style: 'background-color:#09C1FF; color:#fff; border:none;',
                            time: 1000,
                            end: function () {
                                window.parent.loselay();
                            }
                        });
                    } else if (data.code == '2') {
                        op = 1;
                        layer.close(index);
                        layer.msg(data.result, {icon: 5, time: 1500});
                    } else if (data.code == '3') {
                        op = 1;
                        layer.close(index);
                        layer.msg(data.result, {icon: 5, time: 1500});
                    }
                }, 'json');
        }
    }

</script>

</body>
</html>
